{if IS_USE_MODULE}
<div class="portlet portlet-sortable light bordered">
    <div class="portlet-title tabbable-line">
        <div class="caption">
            <i class="fa fa-bar-chart"></i>
            <span class="caption-subject"> {dr_lang(' IM 统计')} </span>
        </div>
    </div>
    <div class="portlet-body">
        
        {count action=table table=1_duixin return=duixin} 
        {count action=table table=1_duixin DAY_inputtime=0 return=duixinjintian} 
        {count action=table table=1_duixin yidu=1 return=duixinyidu}
        {count action=table table=1_duixin yidu=0 return=duixinweidu}
        

        <div class="table-scrollable">
            <table class="table table-mtotal table-nomargin table-bordered table-striped table-bordered table-advance">
                <thead>
                <tr>
                    <th style="text-align: center">{dr_lang('分类')}</th>
                    <th style="text-align: center">{dr_lang('总数据')}</th>
                    <th style="text-align: center">{dr_lang('今日新增')}</th>
                    <th style="text-align: center">{dr_lang('已读')}</th>
                    <th style="text-align: center">{dr_lang('未读')}</th>
                    <th>{dr_lang('操作')}</th>
                </tr>
                </thead>
                <tbody>
                
                <tr>
                    <td>总数</td>

                    <td style="text-align: center"><a class="drlabel drlabel-success" href="{dr_url('duixin/home/index')}">{$duixin_count}</a></td>
                    <td style="text-align: center"><a class="drlabel drlabel-success" href="{dr_url('duixin/home/index')}">{$duixinjintian_count}</a></td>
                    <td style="text-align: center"><a class="drlabel drlabel-success" href="{dr_url('duixin/home/index',['field'=>'yidu','keyword'=>'1'])}">{$duixinyidu_count}</a></td>
                    <td style="text-align: center"><a class="drlabel drlabel-success" href="{dr_url('duixin/home/index',['field'=>'yidu','keyword'=>'1'])}">{$duixinweidu_count}</a></td>
                    
                    <td>
                        <a class="btn btn-xs dark" href="{dr_url('duixin/home/index')}" >{dr_lang('管理')}</a>
                        
                    </td>
                </tr>
                
                {php $dataim = XR_M()->dbprefix();}
                {php $biaoim=$dataim.'1_duixin';}
                
                {category module=duixin show=1 pid=0}
                <tr>
                    <td>{$t.name}</td>

                    <td style="text-align: center"><a class="drlabel drlabel-success" href="{dr_url('duixin/home/index',['catid'=>$t.id])}">{count action=sql sql='select * from $biaoim WHERE catid = $t.id' return=tiezia} {$tiezia_count}</a></td>
                    <td style="text-align: center"><a class="drlabel drlabel-success" href="{dr_url('duixin/home/index',['catid'=>$t.id])}">
                        {count action=sql sql='select * from $biaoim WHERE catid = $t.id AND DATEDIFF(from_unixtime(inputtime),now())=0' return=tieziajintian} {$tieziajintian_count}
                        </a></td>
                    <td style="text-align: center"><a class="drlabel drlabel-success" href="{dr_url('duixin/home/index',['catid'=>$t.id,'field'=>'yidu','keyword'=>'1'])}">
                        {count action=sql sql='select * from $biaoim WHERE catid = $t.id AND yidu=1' return=tieziayidu} {$tieziayidu_count}
                        </a></td>
                    <td style="text-align: center"><a class="drlabel drlabel-success" href="{dr_url('duixin/home/index',['catid'=>$t.id,'field'=>'yidu','keyword'=>'0'])}">
                        {count action=sql sql='select * from $biaoim WHERE catid = $t.id AND yidu=0' return=tieziaweidu} {$tieziaweidu_count}
                        </a></td>
                    
                    <td>
                        <a class="btn btn-xs dark" href="{dr_url('duixin/home/index',['catid'=>$t.id])}" >{dr_lang('管理')}</a>
                        
                    </td>
                </tr>
                {/category}
                
                
                </tbody>
            </table>

        </div>
    </div>
</div>
{/if}